import * as api from '../../api/structure';

export default {
  namespaced: true,
  state: {
    list: [],
  },
  mutations: {
    SET_STURCTURE (state, newStructure) {
      state.list = newStructure;
    },
  },
  actions: {
    async updateStructure (context) {
      const res = await api.getStructure();
      context.commit('SET_STURCTURE', res.depts);
    },
  },
};
